// N1Exception.cpp: implementation of the N1Exception class.
//
//////////////////////////////////////////////////////////////////////

#include "N1Exception.h"

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

N1Exception::N1Exception() {
}

N1Exception::~N1Exception() {
}

void N1Exception::Throw(const char* Format, ...) {
   va_list marker;
   va_start( marker, Format);
   N1String str(Format, marker);
   va_end( marker );
//__FILE__
//__LINE__;
}

#if defined(WINDOWS) && !defined(WINCE) 

enum N1ExceptionHandleAction {
    N1_EXCEPTION_CONTINUE_SEARCH = 0, 
    N1_EXCEPTION_EXECUTE_HANDLER = 1, 
    N1_EXCEPTION_CONTINUE_EXECUTION =-1
};

typedef N1ExceptionHandleAction (*exceptionHandler)();

static LONG WINAPI N1LibUnhandledExceptionFilter(struct _EXCEPTION_POINTERS* ExceptionInfo)
{
    DWORD exceptionCode = ExceptionInfo->ExceptionRecord->ExceptionCode;
    void *exceptionAddr = ExceptionInfo->ExceptionRecord->ExceptionAddress;
    DWORD numberParams  = ExceptionInfo->ExceptionRecord->NumberParameters;
    _EXCEPTION_RECORD *nestedException = ExceptionInfo->ExceptionRecord->ExceptionRecord;

    return EXCEPTION_CONTINUE_SEARCH;
}

int a() 
{
    SetErrorMode(SEM_FAILCRITICALERRORS|SEM_NOALIGNMENTFAULTEXCEPT||SEM_NOGPFAULTERRORBOX);
    SetUnhandledExceptionFilter(N1LibUnhandledExceptionFilter);
    return 1;
}

#endif

